import request from "@/utils/request.js";
import Cache from "@/utils/cache.js"
const url = '/salesman'
const url_m = '/mrhm-customer'

/**
 * 登录
 */
export function login(data) {
	return request.post(url + '/open/auth/login', data, {
		noAuth: true
	});
}

/**
 * 手机号验证码登录
 */
export function phoneCodeLogin(data) {
	return request.post(url_m + '/customer/open/phoneCodeLogin', data, {
		noAuth: true
	});
}

/**
 * 登录静默授权
 * /wechat/getOpenId
 */
export function getOpenId(data) {
	return request.post(url + '/wechat/getOpenId', data);
}

/**
 * 获取验证码
 */
export function sendMsm(mobile) {
	return request.get(url_m + `/sms/open/sendVerificationCode/${mobile}?scene=2001`, {}, {
		noAuth: true
	});
}

/**
 * 找回密码登录
 */
export function changePassword(data) {
	return request.post(url + '/open/forgotPassword/changePassword', data);
}


/**
 * 登录成功后获取业务员信息
 */
export function salesmanInfo() {
	return request.get(url + `/salesman/info`);
}


/**
 * 获取业务员个人信息-开放接口(客户申请业务员后获取状态在用)
 */
export function ifSalesman(id) {
	return request.get(url + `/open/getSalesmanInfo/${id}`);
}